package com.example.langchaindemo.aiservice;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(wiringMode = AiServiceWiringMode.EXPLICIT
                      ,chatModel = "openAiChatModel"
                      ,streamingChatModel = "openAiStreamingChatModel"
                      ,chatMemory = "chatMemory"
                      ,chatMemoryProvider = "chatMemoryProvider"
                      ,contentRetriever = "contentRetriever"//配置数据库检索对象
                      ,tools = "reservationTool")
public interface ConsultantService {
    @SystemMessage(fromResource = "system.txt")
    Flux<String> askStreaming(@MemoryId String memoryId,@UserMessage String message);
}
